﻿using System.Threading.Tasks;

namespace XUCore.WeChat.Enterprise
{
    /// <summary>
    /// 企业微信token管理
    /// </summary>
    public interface IEnterpriseWeChatTokenManager
    {
        /// <summary>
        /// 获取企业微信的Access Token
        /// </summary>
        /// <param name="suiteId"></param>
        /// <param name="corpId"></param>
        /// <param name="agentId"></param>
        /// <returns></returns>
        Task<string> GetAccessTokenAsync(string suiteId, string corpId, int agentId);
    }

    /// <summary>
    /// 企业微信jsapi tocket管理
    /// </summary>
    public interface IEnterpriseWeChatTicketManager
    {
        /// <summary>
        /// 获取Agent ticket
        /// </summary>
        /// <param name="suiteId"></param>
        /// <param name="corpId"></param>
        /// <param name="agentId"></param>
        /// <returns></returns>
        Task<string> GetAgentTicketAsync(string suiteId, string corpId, int agentId);

        /// <summary>
        /// 获取Enterprise ticket
        /// </summary>
        /// <param name="suiteId"></param>
        /// <param name="corpId"></param>
        /// <param name="agentId"></param>
        /// <returns></returns>
        Task<string> GetEnterpriseTicketAsync(string suiteId, string corpId, int agentId);
    }

    /// <summary>
    /// 企业微信获取网页授权签名
    /// </summary>
    public interface IEnterpriseWeChatWebSignature
    {
        /// <summary>
        /// 创建应用网页授权签名，对应agentConfig 和 wx.Config
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<EnterpriseWebSignatureResult> Create(EnterpriseWebSignatureRequest request);

        /// <summary>
        /// 创建应用网页授权签名，对应agentConfig
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<EnterpriseWebSignatureResult.SignatureResult> CreateAgentSignature(EnterpriseWebSignatureRequest request);


        /// <summary>
        /// 创建企业网页授权签名，对应wx.Config
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<EnterpriseWebSignatureResult.SignatureResult> CreateEnterpriseSignature(EnterpriseWebSignatureRequest request);
    }
}